package sortingBasic.usingComparable;

public class Student implements Comparable<Student>{

    public Student(){}

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }
    private String name;
    private int score;

    public String getName() {
        return name;
    }

    public int getScore() {
        return score;
    }

    @Override
    public int compareTo(Student that) {
        if(this.score > that.score) {
            return 1;
        } else if (this.score < that.score) {
            return -1;
        } else {
            return 0;
        }
    }

    @Override
    public String toString() {
        return "name = " + this.name + "    score = " + this.score;
    }
}
